package com.young.financial.controller;

import com.young.financial.service.IntegralPayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/gyintegralpay")
public class IntegralPayController {
    @Autowired
    private IntegralPayService integralPayService;

    /**
     * 积分支付获取预支付信息接口
     * @param requestMap
     * @return
     */
    @PostMapping("/integralprepay")
    public Map<String,Object> integralprepay(@RequestParam Map<String,Object> requestMap){
        return integralPayService.integralprepay(requestMap);
    }

    /**
     * 积分支付（支付完成后调用异步通知的接口）
     * @param requestMap
     * @return
     */
    @PostMapping("/integralpay")
    public Map<String,Object> integralpay(@RequestParam Map<String,Object> requestMap){
        return integralPayService.integralpay(requestMap);
    }
    /**
     * 积分的代付接口
     *
     * @Author Vincentxin
     * @Date 2019/9/17 19:27
     * @param requestMap
     * @return java.lang.Boolean
     **/
    @PostMapping("/integralPayment")
    public Boolean integralPayment(@RequestParam Map<String,Object> requestMap){
        return integralPayService.payment(requestMap);
    }

    /**
     *  积分退款
     * @param requestMap
     * @return
     */
    @PostMapping("/integralrefund")
    public Map<String,Object> integralrefund(@RequestParam Map<String,Object> requestMap){
        return integralPayService.integralrefund(requestMap);
    }
    /**
     * 积分主动查询
     */
    @PostMapping("/intergralpayQuery")
    public Map<String,Object> intergralpayQuery(@RequestParam Map<String,Object> requestMap){
        return integralPayService.intergralpayQuery(requestMap);
    }

    /**
     * 主动查询积分代付
     */
    @PostMapping("/integralPaymentQuery")
    public Map<String,Object> integralPaymentQuery(@RequestParam Map<String,Object> requestMap){
        return integralPayService.integralPaymentQuery(requestMap);
    }
}
